
package com.ami.kvm.jviewer.kvmpkts;

import com.ami.iusb.CDROMRedir;
import com.ami.iusb.FloppyRedir;
import com.ami.iusb.HarddiskRedir;
import com.ami.kvm.jviewer.JViewer;
import com.ami.kvm.jviewer.gui.InfoDialog;
import com.ami.kvm.jviewer.gui.JVFrame;
import com.ami.kvm.jviewer.gui.JViewerApp;
import com.ami.kvm.jviewer.gui.LocaleStrings;
import com.ami.kvm.jviewer.gui.VideoRecord;
import java.awt.Component;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;

public class ConfPkt {
	public static final int NAME_MAX_LENGTH = 17;
	private char[] serviceName = new char[17];
	private byte currentState;
	private char[] interfaceName = new char[17];

	private int nonSecureAccessPort;

	private int secureAccessPort;

	private int sessionInactivityTimeout;

	private byte maxAllowedSessions;
	private byte currentActiveSession;
	private int maxSessionInactivityTimeout;
	private int minSessionInactivityTimeout;
	public static final String SERV_CD_MEDIA = "cd-media";
	public static final String SERV_FD_MEDIA = "fd-media";
	public static final String SERV_HD_MEDIA = "hd-media";
	public static final int CONF_PKT_SIZE = 57;
	public static final short CONF_SERVICE_COUNT = 5;
	public static final short CHANGE_CURR_STATE = 0;
	public static final short CHANGE_IFACE_NAME = 1;
	public static final short CHANGE_NON_SEC_PORT = 2;
	public static final short CHANGE_SEC_PORT = 3;
	public static final short CHANGE_TIME_OUT = 4;
	public static final short CHANGE_MAX_SESSION = 5;
	public static final short CHANGE_CURR_ACTIVE_SESS = 6;
	public static final short CHANGE_MAX_TIME_OUT = 7;
	public static final short CHANGE_MIN_TIME_OUT = 8;
	public static boolean confModified = false;

	public ConfPkt(byte[] paramArrayOfByte) {
		ByteBuffer localByteBuffer = ByteBuffer.wrap(paramArrayOfByte);
		localByteBuffer.order(ByteOrder.LITTLE_ENDIAN);
		byte[] arrayOfByte = new byte[17];
		localByteBuffer.get(arrayOfByte);
		this.serviceName = new String(arrayOfByte).toCharArray();
		this.currentState = localByteBuffer.get();
		localByteBuffer.get(arrayOfByte);
		this.interfaceName = new String(arrayOfByte).toCharArray();
		this.nonSecureAccessPort = localByteBuffer.getInt();
		this.secureAccessPort = localByteBuffer.getInt();
		this.sessionInactivityTimeout = localByteBuffer.getInt();
		this.maxAllowedSessions = localByteBuffer.get();
		this.currentActiveSession = localByteBuffer.get();
		this.maxSessionInactivityTimeout = localByteBuffer.getInt();
		this.minSessionInactivityTimeout = localByteBuffer.getInt();
	}

	public String getServiceName() {
		return new String(this.serviceName).trim();
	}

	public void setServiceName(char[] paramArrayOfChar) {
		this.serviceName = paramArrayOfChar;
	}

	public byte getCurrentState() {
		return this.currentState;
	}

	public void setCurrentState(byte paramByte) {
		this.currentState = paramByte;
	}

	public String getInterfaceName() {
		return new String(this.interfaceName).trim();
	}

	public void setInterfaceName(char[] paramArrayOfChar) {
		this.interfaceName = paramArrayOfChar;
	}

	public int getNonSecureAccessPort() {
		return this.nonSecureAccessPort;
	}

	public void setNonSecureAccessPort(int paramInt) {
		this.nonSecureAccessPort = paramInt;
	}

	public int getSecureAccessPort() {
		return this.secureAccessPort;
	}

	public void setSecureAccessPort(int paramInt) {
		this.secureAccessPort = paramInt;
	}

	public int getSessionInactivityTimeout() {
		return this.sessionInactivityTimeout;
	}

	public void setSessionInactivityTimeout(int paramInt) {
		this.sessionInactivityTimeout = paramInt;
	}

	public byte getMaxAllowedSessions() {
		return this.maxAllowedSessions;
	}

	public void setMaxAllowedSessions(byte paramByte) {
		this.maxAllowedSessions = paramByte;
	}

	public byte getCurrentActiveSession() {
		return this.currentActiveSession;
	}

	public void setCurrentActiveSession(byte paramByte) {
		this.currentActiveSession = paramByte;
	}

	public int getMaxSessionInactivityTimeout() {
		return this.maxSessionInactivityTimeout;
	}

	public void setMaxSessionInactivityTimeout(int paramInt) {
		this.maxSessionInactivityTimeout = paramInt;
	}

	public int getMinSessionInactivityTimeout() {
		return this.minSessionInactivityTimeout;
	}

	public void setMinSessionInactivityTimeout(int paramInt) {
		this.minSessionInactivityTimeout = paramInt;
	}

	public void showConfDataChangeMsg(String paramString) {
		confModified = true;
		JViewerApp.getInstance().syncVMediaRedirection();

		Object localObject1 = JViewer.getMainFrame();

		if (JViewerApp.getInstance().getVMDialog() != null) {
			localObject1 = JViewerApp.getInstance().getVMDialog();
		} else if ((JViewerApp.getInstance().getM_videorecord() != null)
				&& (JViewerApp.getInstance().getM_videorecord().getM_videoPath() != null)) {
			localObject1 = JViewerApp.getInstance().getM_videorecord().getM_videoPath();
		}
		String str = getServiceName();
		InfoDialog.showDialog((Component) localObject1,
				str + LocaleStrings.getString("X_1_CP") + "\n" + paramString + LocaleStrings.getString("X_2_CP"),
				LocaleStrings.getString("X_3_CP"), 1);

		if ((str.equalsIgnoreCase("kvm")) || (str.equalsIgnoreCase("web"))) {
			JViewerApp.getInstance().getM_frame().windowClosed();
		}
		synchronized (CDROMRedir.getSyncObj()) {
			CDROMRedir.getSyncObj().notify();
		}
		synchronized (FloppyRedir.getSyncObj()) {
			FloppyRedir.getSyncObj().notify();
		}
		synchronized (HarddiskRedir.getSyncObj()) {
			HarddiskRedir.getSyncObj().notify();
		}
	}
}

/*
 * Location:
 * D:\Users\tianlin\Downloads\JViewer.jar!\com\ami\kvm\jviewer\kvmpkts\ConfPkt.
 * class Java compiler version: 5 (49.0) JD-Core Version: 0.7.1
 */